<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--导入标签库jstl--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
  <title>添加学生信息</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      background-color: #f4f4f4;
      margin: 0;
      padding: 0;
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 100vh;
    }
    .container {
      width: 100%;
      max-width: 500px;
      margin: 50px auto;
      background: white;
      padding: 20px;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
      border-radius: 8px;
      animation: fadeIn 0.5s ease-in-out;
    }
    @keyframes fadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }
    h2 {
      text-align: center;
      color: #333;
      margin-bottom: 20px;
    }
    form {
      display: flex;
      flex-direction: column;
    }
    label {
      margin-bottom: 10px;
      font-weight: bold;
    }
    input[type="text"], input[type="date"], select {
      padding: 10px;
      margin-bottom: 15px;
      border: 1px solid #ccc;
      border-radius: 4px;
      transition: border-color 0.3s ease;
    }
    input[type="text"]:focus, input[type="date"]:focus, select:focus {
      border-color: #007bff;
    }
    input[type="radio"] {
      margin-right: 5px;
    }
    .radio-group {
      display: flex;
      align-items: center;
      margin-bottom: 15px;
    }
    input[type="submit"], input[type="reset"] {
      padding: 10px 20px;
      background-color: #28a745;
      color: white;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      transition: background-color 0.3s ease;
    }
    input[type="submit"]:hover, input[type="reset"]:hover {
      background-color: #218838;
    }
    a {
      display: block;
      text-align: center;
      margin-top: 20px;
      text-decoration: none;
      color: #007bff;
      transition: color 0.3s ease;
    }
    a:hover {
      text-decoration: underline;
      color: #0056b3;
    }
  </style>
</head>
<body>
<div class="container">
  <h2>添加学生信息</h2>
  <form action="addStudent" method="post">
    <input type="hidden" name="sId" value="${stu.sId}">
    <label for="sName">学生姓名:</label>
    <input type="text" id="sName" name="sName" placeholder="学生姓名" required>

    <label for="birth">生日:</label>
    <input type="date" id="birth" name="birth" required>

    <div class="radio-group">
      <label>
        <input type="radio" name="gender" value="男" checked>男
      </label>
      <label>
        <input type="radio" name="gender" value="女">女
      </label>
    </div>

    <label for="clazzId">请选择班级:</label>
    <select id="clazzId" name="clazzId" required>
      <option value="" disabled ${empty clazzList ? 'selected' : ''}>请选择班级</option>
      <c:forEach items="${clazzList}" var="clazz">
        <option value="${clazz.cId}">${clazz.cName}</option>
      </c:forEach>
    </select>

    <input type="submit" value="提交">
    <input type="reset" value="重置">
    <a href="StudentList.jsp">返回</a>
  </form>
</div>
</body>
</html>
